﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeBudget
{
    class RecurringExpense : Expense, IRecurringItem
    {
        private RecurringInterval recurringInterval;
        public RecurringInterval RecurringInterval
        {
            get
            {
                return this.recurringInterval;
            }
            set
            {
                this.recurringInterval = value;
            }
        }

        public RecurringExpense(decimal amount, string name, Category category, RecurringInterval interval)
            : base(amount, name, category)
        {
            this.RecurringInterval = interval;
        }

        public override string ToString()
        {
            StringBuilder returnString = new StringBuilder(base.ToString());
            returnString.AppendFormat("-{0}-{1}", this.Category, this.RecurringInterval);
            return returnString.ToString();
        }
    }
}
